package windows;

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SpringLayout;

public class RemoveAngajatFrame {
	private JFrame frame;
	
	private JComboBox comboBox_RemoveNumeAngajat;
	private JTextField textField_RemoveContAngajat= new JTextField();
	private JTextField textField_RemoveSumaAngajat = new JTextField();
	private JTextField textField_RemoveBancaAngajat = new JTextField();
	private JButton nextButton = new JButton(">>");
	private JButton prevButton = new JButton("<<");
	private JButton deleteAngajatButton = new JButton("Sterge");
	private boolean openedFirstTime=true;
	
	public boolean isOpenedFirstTime() {
		return openedFirstTime;
	}
	public void setOpenedFirstTime(boolean openedFirstTime) {
		this.openedFirstTime = openedFirstTime;
	}
	public JComboBox getComboBox_RemoveNumeAngajat() {
		return comboBox_RemoveNumeAngajat;
	}
	public JButton getDeleteAngajatButton() {
		return deleteAngajatButton;
	}
	public JFrame getFrame() {
		return frame;
	}
	public JButton getNextButton() {
		return nextButton;
	}
	public JButton getPrevButton() {
		return prevButton;
	}
	public JTextField getTextField_RemoveBancaAngajat() {
		return textField_RemoveBancaAngajat;
	}
	public JTextField getTextField_RemoveContAngajat() {
		return textField_RemoveContAngajat;
	}
	public JTextField getTextField_RemoveSumaAngajat() {
		return textField_RemoveSumaAngajat;
	}
	public void setFrame() {
		JPanel panel = new JPanel();
		
		frame = new JFrame("Sterge angajat");
		comboBox_RemoveNumeAngajat= new JComboBox();
		JLabel _labelRemoveNume = new JLabel("Nume angajat:");
		JLabel _labelRemoveCont = new JLabel("Cont:");
		JLabel _labelRemoveSuma = new JLabel("Suma:");
		JLabel _labelRemoveBanca = new JLabel("Banca");
		SpringLayout layout = new SpringLayout();

		

		panel.setLayout(layout);

		panel.add(_labelRemoveNume);
		panel.add(_labelRemoveCont);
		panel.add(_labelRemoveSuma);
		panel.add(_labelRemoveBanca);
		panel.add(comboBox_RemoveNumeAngajat);
		panel.add(textField_RemoveContAngajat);
		panel.add(textField_RemoveSumaAngajat);
		panel.add(textField_RemoveBancaAngajat);
		panel.add(nextButton);
		panel.add(prevButton);
		panel.add(deleteAngajatButton);
		
		nextButton.setActionCommand("nextEmployer");
		prevButton.setActionCommand("prevEmployer");
		deleteAngajatButton.setActionCommand("deleteEmployer");
		comboBox_RemoveNumeAngajat.setActionCommand("selectEmployer");

		comboBox_RemoveNumeAngajat
				.setPreferredSize(new Dimension(250, 25));
		textField_RemoveContAngajat
				.setPreferredSize(new Dimension(250, 30));
		textField_RemoveSumaAngajat
				.setPreferredSize(new Dimension(250, 30));
		textField_RemoveBancaAngajat
				.setPreferredSize(new Dimension(250, 30));

		textField_RemoveContAngajat.setEditable(false);
		textField_RemoveContAngajat.setText("Cont angajat");

		textField_RemoveSumaAngajat.setEditable(false);
		textField_RemoveSumaAngajat.setText("Suma angajat");

		textField_RemoveBancaAngajat.setEditable(false);
		textField_RemoveBancaAngajat.setText("Banca angajat");

		layout.putConstraint(SpringLayout.WEST, _labelRemoveNume, 100,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH, _labelRemoveNume, 20,
				SpringLayout.NORTH,panel);

		layout.putConstraint(SpringLayout.WEST,
				comboBox_RemoveNumeAngajat, 20,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH,
				comboBox_RemoveNumeAngajat, 10,
				SpringLayout.SOUTH, _labelRemoveNume);

		layout.putConstraint(SpringLayout.WEST, _labelRemoveCont, 120,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH, _labelRemoveCont, 10,
				SpringLayout.SOUTH, comboBox_RemoveNumeAngajat);

		layout.putConstraint(SpringLayout.WEST,
				textField_RemoveContAngajat, 20,
				SpringLayout.WEST, panel);
		layout.putConstraint(SpringLayout.NORTH,
				textField_RemoveContAngajat, 10,
				SpringLayout.SOUTH, _labelRemoveCont);

		layout.putConstraint(SpringLayout.WEST, _labelRemoveSuma, 120,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH, _labelRemoveSuma, 10,
				SpringLayout.SOUTH,
				textField_RemoveContAngajat);

		layout.putConstraint(SpringLayout.WEST,
				textField_RemoveSumaAngajat, 20,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH,
				textField_RemoveSumaAngajat, 10,
				SpringLayout.SOUTH, _labelRemoveSuma);

		layout.putConstraint(SpringLayout.WEST, _labelRemoveBanca, 120,
				SpringLayout.WEST, panel);
		layout.putConstraint(SpringLayout.NORTH, _labelRemoveBanca, 10,
				SpringLayout.SOUTH,
				textField_RemoveSumaAngajat);

		layout.putConstraint(SpringLayout.WEST,
				textField_RemoveBancaAngajat, 20,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH,
				textField_RemoveBancaAngajat, 10,
				SpringLayout.SOUTH, _labelRemoveBanca);

		layout.putConstraint(SpringLayout.WEST, prevButton,
				85, SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH,
				prevButton, 10, SpringLayout.SOUTH,
				textField_RemoveBancaAngajat);

		layout.putConstraint(SpringLayout.WEST, nextButton,
				5, SpringLayout.EAST, prevButton);
		layout.putConstraint(SpringLayout.NORTH,
				nextButton, 10, SpringLayout.SOUTH,
				textField_RemoveBancaAngajat);

		layout.putConstraint(SpringLayout.WEST, deleteAngajatButton, 98,
				SpringLayout.WEST,panel);
		layout.putConstraint(SpringLayout.NORTH, deleteAngajatButton, 10,
				SpringLayout.SOUTH, nextButton);

	

		frame.setVisible(true);
		frame.setSize(310, 700);
		frame.getContentPane().add(panel);

	
	}
	public void showFrame() {
		frame.setVisible(true);
		
	}
	public void hide() {
		frame.setVisible(true);
		
	}
	public void dispose() {
		frame.dispose();
		
	}
}

